<!--
	此示例下载自 https://echarts.apache.org/examples/zh/editor.html?c=bar-stack&code=PYBwLglsB2AEC8sDeAoWsDGwA2wBOAXANoDkAxACwAcA7BRgEYkA05Apm1QExcBmL5XlwYBDAAxcBZGgFYGAEwqSAuszSwwwHJBAFk69GDwQA5ibaFYJEQA8IAZxYHYthwAVgEaGAt7U6AI0ATxA2PRJ7AAsReWAAdxJnAF91JLV0bDZzaHk_ZwA3C0gMEWwAQWxTaAISRPQ09RNjXP1AzN4wcIBmAFInQOMTSM6rCj70gIZgME0AW27x5yxvES8AGREGNmw9IwBXNlSJmzK7ez0iZ39A4NDwkp8TfCD-m_kRMBELkkBIOUByv0AxtYsKz_QD2SsCSIBttUBEOh4OUyXUqnUQVODguV2chhCYSs-VKBzqARS6GR6HsFggbHOsEugWugWgIlmuJIXRkgECdQBTyoBTuUA0HKvQJgHHhUR4QUBeyfDAAa3CZXkEvQbFmIGi9nRrRu6F4wAwexpEUp1KJgQa2venwuAEYuGJmLBrV0uA7rWJra6uhQyTcID5ZgBlYWZAgMm5xCDyMCRAhdMRY2Dm4kTdBh9BMlndABsAFoKJylbdWWLC1KRLL5YqUwEVWqRBqaWmArr9YaKcYTQmk4FLV9aTx7Y7uK6AJwe2BcL0Is3VpsZ1kUXP5jmF4V3Kwl6vk6VyqwKwu19Waps6vUG8LtqmOLtb2C9m0yQeTl0T92umTe5KzhPz8IyGQ5lmYgrrea7FiI4q3mWFZ7lWCaHvWx4JqerYXsa17at2AT3rS1qPg6z4EW-joftOyZIigSQANxAA
	⚠ 请注意，该图表不是 Apache ECharts 官方示例，而是由用户代码生成的。请注意鉴别其内容。
-->
<!DOCTYPE html>
<html lang="en" style="height: 100%">
  <head>
    <meta charset="utf-8" />
  </head>
  <body style="height: 100%; margin: 0">
    <div id="container" style="height: 100%"></div>

    <script
      type="text/javascript"
      src="https://registry.npmmirror.com/echarts/5.5.1/files/dist/echarts.min.js"
    ></script>

    <!-- Uncomment this line if you want to dataTool extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/5.5.1/files/dist/extension/dataTool.min.js"></script>
  -->
    <!-- Uncomment this line if you want to use gl extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-gl/2/files/dist/echarts-gl.min.js"></script>
  -->
    <!-- Uncomment this line if you want to echarts-stat extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-stat/latest/files/dist/ecStat.min.js"></script>
  -->
    <!-- Uncomment this line if you want to echarts-graph-modularity extension
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts-graph-modularity/2/files/dist/echarts-graph-modularity.min.js"></script>
  -->
    <!-- Uncomment this line if you want to use map
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/4.9.0/files/map/js/world.js"></script>
  -->
    <!-- Uncomment these two lines if you want to use bmap extension
  <script type="text/javascript" src="https://api.map.baidu.com/api?v=3.0&ak=YOUR_API_KEY"></script>
  <script type="text/javascript" src="https://registry.npmmirror.com/echarts/5.5.1/files/dist/extension/bmap.min.js"></script>
  -->

    <script type="text/javascript">
      var dom = document.getElementById("container");
      var myChart = echarts.init(dom, null, {
        renderer: "canvas",
        useDirtyRect: false,
      });
      var app = {};

      var option;

      option = {
        color: ["#4874cb", "#ee822f", "#f2ba02", "#75bd42"],
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "shadow",
          },
        },
        legend: {
          verticalAlign: "",
        },
        grid: {
          left: "3%",
          right: "4%",
          bottom: "3%",
          containLabel: true,
        },
        xAxis: [
          {
            type: "category",
            data: ["三级正", "三级副", "四级正", "四级副"],
          },
        ],
        yAxis: [
          {
            type: "value",
          },
        ],
        series: [
          {
            name: "35岁及以下",
            type: "bar",
            stack: "Ad",
            emphasis: {
              focus: "series",
            },
            data: [120, 132, 101, 134],
            itemStyle: {
              width: 30,
            },
          },
          {
            name: "36-45岁",
            type: "bar",
            stack: "Ad",
            emphasis: {
              focus: "series",
            },
            data: [220, 182, 191, 234],
          },
          {
            name: "46-45岁",
            type: "bar",
            stack: "Ad",
            emphasis: {
              focus: "series",
            },
            data: [150, 232, 201, 154],
          },
          {
            name: "55-60岁",
            type: "bar",
            stack: "Ad",
            emphasis: {
              focus: "series",
            },
            data: [150, 232, 201, 154],
          },
        ],
      };

      if (option && typeof option === "object") {
        myChart.setOption(option);
      }

      window.addEventListener("resize", myChart.resize);
    </script>
  </body>
</html>
